Micron Document




JavaFX Script
part 5/8 · 12.8 KB total
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
}
}

It shows the following window/frame :

This program can also be written in JavaFX Script using a procedural style this way:

import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.text.Text;
import javafx.scene.text.Font;
var myFont:Font = Font.font(null, 24);
var myText:Text = new Text();
myText.font = myFont;
myText.x = 10;
myText.y = 30;
myText.content = "Hello World";
var myScene:Scene = new Scene();
myScene.content = myText;
var myStage:Stage = new Stage();
myStage.title = "Hello World";
myStage.width = 250;
myStage.height = 80;
myStage.scene = myScene;

See also

Java applet, a means of deploying Java applications inside a web page.
JavaFX, a family of products and technologies intended to be used to create Rich Internet Applications (RIAs).
Swing, the underlying user interface library employed by JavaFX Script.
Curl (programming language), also with a declarative mode with optional typing

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────